package com.ohuang.test_koin.presenter

import com.ohuang.test_koin.data.User
import com.ohuang.test_koin.repository.UserRepository

class UserPresenter(private val repository: UserRepository) {

    fun sayHello(name : String) : String{
        val foundUser = repository.findUser(name)
        return foundUser?.let { "Hello '$it' from $this" } ?: "User '$name' not found!"
    }

    fun addUser(users : List<User>){
        repository.addUsers(users)
    }
}